package com.gopay.common.cps.service.fund.impl;

import com.gopay.common.cps.dao.fund.BindCardBaseDAO;
import com.gopay.common.cps.service.fund.BindCardBaseService;
import com.gopay.common.domain.cps.CpsGenMainOrder;
import com.gopay.common.domain.cps.CpsGenPayOrder;
import com.gopay.common.domain.fund.FundGopayBankcardInfoEntity;
import com.gopay.common.domain.fund.FundGopayCardEntity;
import com.gopay.common.domain.fund.FundGopayCpsGenOrder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @author baiyunpeng
 * @2016年7月14日 下午3:36:05  www.gopay.com.cn Inc.All rights reserved.
 */
@Transactional
@Service("bindCardBaseService")
public class BindCardBaseServiceImpl implements BindCardBaseService {
    //根据国付宝要求去空格
    @Resource(name = "bindCardBaseDAO")
    private BindCardBaseDAO bindCardBaseDAO;
    @Override
    public Object get(Object ob) {
        ob = bindCardBaseDAO.get(ob);
        return ob;
    }
    @Override
    public Integer updateCard(Serializable agentSignNo, Serializable type, String key) {
        return bindCardBaseDAO.updateCardInfo(agentSignNo, type, key);
    }
    @Override
    public Integer updateCardInfo(Serializable agentSignNo, Serializable type, String key) {
        return bindCardBaseDAO.updateCardInfo(agentSignNo, type, key);
    }
    @Override
    public Object find(Serializable agentSignNo,Serializable merId,Serializable type) {
        Object o = bindCardBaseDAO.find(agentSignNo,merId,type);
        return o;
    }
    @Override
    public Integer updateDtlForCardInfo(Serializable cardNo, Serializable bankCode, Serializable mobile, Serializable seq, Serializable memo,Date date) {
        return bindCardBaseDAO.updateDtlForCardInfo(cardNo, bankCode, mobile, seq, memo,date);
    }
    @Override
    public FundGopayBankcardInfoEntity getEntity(String id, String agenSignNo) {
        return bindCardBaseDAO.getEntity(id, agenSignNo);
    }
    @Override
    public void saveOrder(FundGopayBankcardInfoEntity fundGopayBankcardInfoEntity, FundGopayCardEntity fundGopayCardEntity) {
        bindCardBaseDAO.saveOrder(fundGopayBankcardInfoEntity, fundGopayCardEntity);
    }
    @Override
    public void unBindCard(FundGopayBankcardInfoEntity fundGopayBankcardInfoEntity, FundGopayCardEntity fundGopayCardEntity) {
        bindCardBaseDAO.unBindCard(fundGopayBankcardInfoEntity, fundGopayCardEntity);
    }
    @Override
    public void saveZeroOrder(final List<FundGopayCpsGenOrder> orderList, final List<CpsGenMainOrder> mainOrderList) {
        bindCardBaseDAO.saveZeroOrder(orderList, mainOrderList);
    }
    @Override
    public void saveThreeOrder(List<FundGopayCpsGenOrder> orderList, List<CpsGenMainOrder> mainOrderList, final List<CpsGenPayOrder> cpsGenPayOrderList, Map<String, Object> map, String key) {
        bindCardBaseDAO.saveThreeOrder(orderList, mainOrderList, cpsGenPayOrderList, map, key);
    }
    @Override
    public void updateSuccessOrderCauseDiffer(Map<String, Map<String, Object>> maps) {
        bindCardBaseDAO.updateSuccessOrderCauseDiffer(maps);
    }
    @Override
    public void updateFailOrderCauseDiffer(Map<String, Map<String, Object>> toatlMap) {
        bindCardBaseDAO.updateFailOrderCauseDiffer(toatlMap);
    }
    @Override
    public boolean checkerMoney(Map<String, Object> maps) {
        boolean b = bindCardBaseDAO.checkerMoney(maps);
        return false;
    }
    @Override
    public void updateCardByBind(FundGopayCardEntity fundGopayCardEntity, FundGopayBankcardInfoEntity fundGopayBankcardInfoEntity) {
        bindCardBaseDAO.updateCardByBind(fundGopayCardEntity,fundGopayBankcardInfoEntity);
    }

    @Override
    public List<FundGopayCardEntity> getBindCard(Map<String, Object> param){
        return bindCardBaseDAO.getBindCard(param);
    }
}
